#include<vector>
#include<iostream>
using namespace std;
class DenseGraph
{
private:
    int m;
    int n;
    bool isDirected;
    vector<vector<bool>>g;
    /* data */
public:
    DenseGraph(int m,int n,bool isDirected){
        this->n=n;
        this->m=m;
        this->isDirected=isDirected;
        for (int i = 0; i < n; i++)
        {
            //初始化NxN矩阵，且没有边
            g.push_back(vector<bool>(n,false));
            /* code */
        }
        
    };
    void addEdge(int v,int w){
        if (hasEdge(v,w))
        {
            return;
            /* code */
        }
        g[v][w]=true;
        //假如是无响图，我们要两个方向都要连接
        if (!isDirected)
        {
            g[w][v]=true;
            /* code */
        }
        m++;
    }
    bool hasEdge(int v,int w){
        if (g[v][w])
        {
            //有值就证明有边
            return true;
            /* code */
        }
        //
        return false;
        
    }
    ~DenseGraph();
};

